package test;

import diseaseandcureadministration.Clinic;
import diseaseandcureadministration.Patient;
import diseaseandcureadministration.PatientDiedException;
import diseaseandcureadministration.disease.Disease;
import diseaseandcureadministration.disease.DiseaseRegistry;
import diseaseandcureadministration.registry.Registry;
import diseaseandcureadministration.symptom.Symptom;
import diseaseandcureadministration.symptom.SymptomRegistry;

public class ClinicRunner {

	public static void main(String[] args) throws PatientDiedException 
	{
		Clinic clinic = new Clinic();
		
		Registry diseases = DiseaseRegistry.getRegistryInstance();
		Registry symptons = SymptomRegistry.getRegistryInstance();
		
		Patient healthyPatient = new Patient("John Doe");
		System.out.println(healthyPatient);
		clinic.enterClinic(healthyPatient);
		System.out.println(healthyPatient);
		
		healthyPatient = new Patient("Not So Healthy Janice");
		Symptom symptom = (Symptom) symptons.getElementByName("Coughing");
		healthyPatient.addSymptom(symptom);
		symptom = (Symptom) symptons.getElementByName("Fever");
		healthyPatient.addSymptom(symptom);
		System.out.println(healthyPatient);
		clinic.enterClinic(healthyPatient);
		System.out.println(healthyPatient);
		
		
		Disease disease = (Disease) diseases.getElementByName("Blood Infection");
		Patient infectedPatient = new Patient("Infected Glenn", disease);
		System.out.println(infectedPatient);
		clinic.enterClinic(infectedPatient);
		System.out.println(infectedPatient);
		
				
		disease = (Disease) diseases.getElementByName("Throat Infection");
		infectedPatient = new Patient("Doomed Jack", disease);
		disease = (Disease) diseases.getElementByName("Stress");
		infectedPatient.infect(disease);
		System.out.println(infectedPatient);
		clinic.enterClinic(infectedPatient);
		System.out.println(infectedPatient);
	}
}
